package com.sj.leetcode.editor.cn.sort;

import java.util.ArrayList;
import java.util.List;

public class Exam {
//    班级 10人 按照 数学、英语、语文的成绩 从高到低排序；

//  name xk score  [zs][math][100]

    public static void main(String[] args) {
        List<Stu> stus = new ArrayList<>();
        List<Stu> maths = new ArrayList<>();
        List<Stu> englishs = new ArrayList<>();
        List<Stu> chinese = new ArrayList<>();
        for (Stu stu : stus) {
            if ("math".equals(stu.getXk())) {
                maths.add(stu);
            } else if ("english".equals(stu.getXk())) {
                englishs.add(stu);
            } else if ("chinese".equals(stu.getXk())) {
                chinese.add(stu);
            }
        }

    }

    public void sort(int[] arr) {
        for (int i = 0; i < arr.length; i++) {
            for (int j = arr.length - 1; j > i; j--) {
                if (arr[j - 1] > arr[j]) {
                    swap(arr, j, j - 1);
                }
            }
        }
    }

    private void swap(int[] arr, int j, int i) {
        int temp = arr[i];
        arr[i] = arr[j];
        arr[j] = temp;
    }


    class Stu implements Comparable<Stu>{
        private String name;
        private String xk;
        private double score;

        public Stu() {
        }


        public Stu(String name, String xk, int score) {
            this.name = name;
            this.xk = xk;
            this.score = score;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getXk() {
            return xk;
        }

        public void setXk(String xk) {
            this.xk = xk;
        }

        public double getScore() {
            return score;
        }

        public void setScore(double score) {
            this.score = score;
        }

        @Override
        public int compareTo(Stu o) {
//            return scor
            return 0;
        }
    }


}
